package hczc.longcai.com.hccrowdfunding.home.fourth_mine.utils;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import hczc.longcai.com.hccrowdfunding.R;
import hczc.longcai.com.hccrowdfunding.home.fourth_mine.activities.AddressManageActivity;
import hczc.longcai.com.hccrowdfunding.home.fourth_mine.activities.AlterPasswdActivity;
import hczc.longcai.com.hccrowdfunding.home.fourth_mine.activities.ChangePhoneNumberActivity;
import hczc.longcai.com.hccrowdfunding.home.fourth_mine.activities.ApproveActivity;
import hczc.longcai.com.hccrowdfunding.home.fourth_mine.fragments.Mine_Data_Normal_Fragment;

/**
 * 我的资料监听器
 * Created by Administrator on 2016/1/28.
 */
public class MineDataClickListener implements View.OnClickListener {

    private Context context;
    private int state;

    public MineDataClickListener(Context context, int state) {
        this.context = context;
        this.state = state;
    }

    @Override
    public void onClick(View v) {
        switch (state){
            case Mine_Data_Normal_Fragment.STATE_NICKNAME:

                break;
            case Mine_Data_Normal_Fragment.STATE_CHANGEPHONENUMBER:
                TextView text = (TextView) v.findViewById(R.id.mine_data_normal_state);
                String number = text.getText().toString().trim();
                Intent intent = new Intent(context, ChangePhoneNumberActivity.class);
                Bundle bundle = new Bundle();
                bundle.putString("number",number);
                intent.putExtras(bundle);
                context.startActivity(intent);
                break;
            case Mine_Data_Normal_Fragment.STATE_ADDRESS:
                context.startActivity(new Intent(context, AddressManageActivity.class));
                break;
            case Mine_Data_Normal_Fragment.STATE_APPLY:
                context.startActivity(new Intent(context, ApproveActivity.class));
                break;
            case Mine_Data_Normal_Fragment.STATE_CHANGEPASSWD:
                context.startActivity(new Intent(context, AlterPasswdActivity.class));
                break;
        }


    }
}
